#include "BulletMoveController.h" 

bool BulletMoveController::init(){
	m_moveSpeed = 20;
	this->scheduleUpdate();
	
	return true;
}

void BulletMoveController::update(float dt){
	if (m_controllerListener == NULL){
		return;
	}
	
	auto rota = m_controllerListener->getTagRotation();
	auto pos = m_controllerListener->getTagPosition();

	pos += Vec2(m_moveSpeed*sin(CC_DEGREES_TO_RADIANS(rota)), m_moveSpeed*cos(CC_DEGREES_TO_RADIANS(rota)));
	
	m_controllerListener->setTagPosition(pos.x, pos.y);
}

